package com.example.barcodeapp.persenter;

import com.example.barcodeapp.base.BasePersenter;
import com.example.barcodeapp.common.CommonSubscriber;
import com.example.barcodeapp.interfaces.own.IOwn;
import com.example.barcodeapp.model.HttpManager;
import com.example.barcodeapp.ui.own.bean.YouHuiJuanBean;
import com.example.barcodeapp.ui.wode.bean.JifengBiChongZhiJinEBean;
import com.example.barcodeapp.ui.wode.bean.JifengbichongzhishuomingBean;
import com.example.barcodeapp.ui.wode.bean.YouHuiJuanQuanBuBean;
import com.example.barcodeapp.utils.RxUtils;

public class OnePresenterYouHuiJuan extends BasePersenter<IOwn.Viewyouhuijuani> implements IOwn.Persenteryouhuijuan {


    @Override
    public void getyouhuijuan() {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getyouhuijuan()
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<YouHuiJuanBean>(mView) {
                    @Override
                    public void onNext(YouHuiJuanBean hanFuDaBean) {
                        mView.getyouhuijuan(hanFuDaBean);
                    }
                }));
    }

    @Override
    public void getyouhuijuan(int page, int isguoqi) {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getyouhuijuan(page,isguoqi)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<YouHuiJuanBean>(mView) {
                    @Override
                    public void onNext(YouHuiJuanBean hanFuDaBean) {
                        mView.getyouhuijuan(hanFuDaBean);
                    }
                }));
    }
}
